#pragma once
#include <WS2tcpip.h>
#include <WinSock2.h>

const int BUFFER_SIZE = 1024;

class pSocket
{
public:
	pSocket();
	pSocket(SOCKET socket);
	~pSocket();
	byte * GetBuffer() { return _recvBuffer; };
	void Send(const byte * buffer, int len) const;
	int Receive(byte * buffer, SOCKET socket, const int nBytes);
	static void InitWinSock(WSADATA & wsaData);
	static void CleanWinSock(); 
protected:
	SOCKET _baseSocket;
	byte*  _recvBuffer;
};



